Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: Macintosh Toolbox Essentials

Previous | Chapter Top | Chapter Contents | Next |

Reading the Mouse

The Event Manager provides functions you can use to get information about the mouse. You can get the current mouse location using the GetMouse function (GetMouse) . You can use the Button function (Button) to determine whether the user pressed the mouse button. After receiving a mouse-down event, you can use the StillDown function (StillDown) to determine whether the mouse button is still down, and you can use WaitMouseUp (WaitMouseUp) to determine if the user subsequently released the mouse.

GetMouse

You can use the GetMouse function to obtain the current mouse location.

pascal void GetMouse (Point *mouseLoc);
mouseLoc
Returns a pointer to a point describing the current mouse location in local coordinates of the current graphics port (for example, the active window). Note that this value differs from the value of the where field of the event record, which specifies the mouse location in global coordinates.

Button

You can use the Button function to determine whether the user pressed the mouse button.

pascal Boolean Button (void);

DESCRIPTION

The Button function looks in the Operating System event queue for a mouse-down event. If it finds one, the Button function returns true ; otherwise, it returns false . To determine whether the mouse button is still down after a mouse-down event, use the StillDown function.

SEE ALSO

See "The Event Queue" for information about the Operating System event queue.

StillDown

After receiving a mouse-down event, you can use the StillDown function to determine if the mouse button is still down.

pascal Boolean StillDown (void);

DESCRIPTION

The StillDown function looks in the Operating System event queue for a mouse event. If it finds one, the StillDown function returns false . If it does not find any mouse events pending in the Operating System event queue, the StillDown function returns true .

SEE ALSO

See "The Event Queue" for information about the Operating System event queue.

WaitMouseUp

After receiving a mouse-down event, you can use the WaitMouseUp function to determine if the user subsequently released the mouse.

pascal Boolean WaitMouseUp (void);

DESCRIPTION

The WaitMouseUp function looks in the Operating System event queue for a mouse-up event. If it finds one, the WaitMouseUp function removes the mouse-up event from the queue and returns false . If it does not find any mouse up events pending in the Operating System event queue, the WaitMouseUp function returns true .

SEE ALSO

See "The Event Queue" for information about the Operating System event queue.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next